Skip to content

[PostRector] Fix unused import not removed on empty generic class name exists#5012

Merged
samsonasik merged 4 commits intomainfrom
fix-unused-import
Sep 13, 2023
Merged

[PostRector] Fix unused import not removed on empty generic class name exists#5012
samsonasik merged 4 commits intomainfrom
fix-unused-import

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik changed the title [PostRector] Fix unused import not removed on generic class name exists [PostRector] Fix unused import not removed on empty generic class name exists Sep 13, 2023

namespace Rector\NodeTypeResolver\Node;

use PHPStan\Analyser\Scope;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm.., it seems cause it used as @see Scope removed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it because @see is exists inside PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTextNode:

PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTextNode #18819
   text: 'Contains @see Scope'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by make @see not part of text, but independent docblock ac93c3e

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 74df774 into main Sep 13, 2023
@samsonasik samsonasik deleted the fix-unused-import branch September 13, 2023 12:28
@TomasVotruba
Copy link
Copy Markdown
Member

Looks good 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[rector-src] removeUnusedImports() not working on packages/Config/RectorConfig.php

3 participants